'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  router.post('/login', controller.login.index);
  router.post('/v1/logout', controller.login.logout);
  router.get('/v1/getUser', controller.login.getUser);
  router.get('/redirect', controller.login.redirect);

  router.post('/v1/register', controller.login.register);
  router.get('/v1/home/phoneList', controller.home.phoneList);
  router.get('/v1/home/banner', controller.home.banner);
  router.get('/v1/home/filterMenu', controller.home.filterMenu);
  router.get('/v1/home/phoneDetail', controller.phone.phoneDetail);

  router.get('/v1/book/banner', controller.book.banner);
  router.get('/v1/book/detail', controller.book.detail);

  router.post('/v1/home/pay', controller.home.pay);
};
